<? 
	include('base.php');
	User::isAdmin();
	$section='releases';
	include_class('releases');
	include_class('m2');
	include('layout/header.php');
	
?>

<div id="breadcrumb">
	<a href="index.php">Audition &#62;</a>
	Releases
</div>

	<h1>releases:</h1>
	<div class="inset">
	<p>
	<?
		$rl = new ReleaseList();
		$rli = $rl->get_releases();
	?>
		<? if (User::isAdmin()) { ?><a href="release_add.php">Add Release</a><? } ?>
	</p>
	<p>
	<table border="0" cellspacing="0" cellpadding="0" width="450">
	<?
		if (is_array($rli) && count($rli) > 0) {
		foreach ($rli as $r) { ?>
		<tr>
			
			<td style="padding: 0px 10px 10px 0px">
			<?
			
			$mi = $r->getCover();
			
			if (!db::isError($mi) && is_object($mi)) {
				echo $mi->printThumbnail();
			} else {
				echo("&nbsp;");
			}
			
			?>
			</td>
			<td><a href="release_edit.php?id=<?=$r->getID()?>"><?=$r->getTitle()?></a> <? if (!$r->isActive()) { ?><img src="images/inactive.gif" alt="Entry is Inactive" width="10" height="10" title="Entry is Inactive"><? } ?></td>
			<td align="center"><?=$r->getDate('Y')?></td>
		</tr>				
		<? }
		} else { ?>
			<tr>
				<td colspan="3">No releases.</td>
			</tr>
		<? }
	
	?>
	</table>
	</p>		
	</div>

<? include('layout/footer.php'); ?>
